package com.huaxin.device.dto.request;

import com.huaxin.device.dto.enums.validation.ValidCircuitBreakerAction;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.time.LocalTime;

@Data
public class CircuitBreakerScheduleUpdateReqDTO {

    /**
     * ID（必填）
     */
    @NotBlank(message = "ID不能为空")
    @Schema(description = "任务ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "123e4567-e89b-12d3-a456-426614174000")
    private String id;

    /**
     * 设备ID
     */
    @NotBlank(message = "设备ID不能为空")
    @Schema(description = "设备ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "d123e456-789a-bcde-f012-3456789abcde")
    private String deviceId;

    /**
     * 任务名称
     */
    @NotBlank(message = "任务名称不能为空")
    @Schema(description = "任务名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "工作日定时分闸")
    private String scheduleName;

    /**
     * 操作类型
     */
    @Schema(description = "操作类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "open")
    @NotNull(message = "操作类型不能为空")
    @ValidCircuitBreakerAction
    private String action;

    /**
     * 触发时间（HH:mm:ss）
     */
    @NotBlank(message = "触发时间不能为空")
    @Schema(description = "触发时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "08:00:00")
    private LocalTime triggerTime;

    /**
     * 重复周期（JSON数组，1-7）
     */
    @Schema(description = "重复周期（1-7，1=周日）", example = "[1,2,3,4,5]")
    private String repeatDays;

    /**
     * 组织家族ID
     */
    @Schema(description = "组织家族ID", example = "f3b2f8e1-4c5d-4e6f-8b2a-1c2d3e4f5a6b")
    private String familyId;
}